package com.ddxz.tool.web.dto;

import com.ddxz.tool.core.common.DdxzStatus;
import com.ddxz.tool.core.exception.DdxzBaseException;
import com.ddxz.tool.web.common.ConstData;

/**
 * @author 朱宗刚
 * @version 1.0.0
 * @description com.casic.exchange.com.casic.common.tools.dto.CasicException
 * @date 2020/2/28
 */
public class DdxzException extends DdxzBaseException {
    static final long serialVersionUID = 820200727151503L;

    public DdxzException(DdxzStatus status, Object... args) {
        super(status, args);
    }

    public DdxzException(DdxzStatus status, Throwable throwable, Object args) {
        super(throwable, status, args);
    }

    public DdxzResponse getResponse() {
        DdxzResponse response = DdxzResponse.correct(ConstData.OK_MESSAGE);
        response.setData(null);
        response.setMessage(this.getMessage());
        response.setStatus(this.getStatus());

        return response;
    }
}
